import { postUrlDataApi } from "@/api/data-object";
import { ref } from 'vue'
interface DataType {
    id: string;
}

export default function useUserRepositories(formState: any) {
    const repositories = ref<DataType[]>([]);
    const total = ref<number>(0);
    const getUserRepositories = async () => {
        let data: any = await postUrlDataApi('/resource/jbxxb/list', formState);
        repositories.value = data.rows;
        total.value = data.total;
        return {
            total: total.value,
            repositories: repositories.value,
        }
    }
    return {
        total,
        repositories,
        getUserRepositories
    }
}